Fix test 11_create_concurrent_ps.py for HVM domains. HVM can only
authorstekloff@elm3b216.beaverton.ibm.com <stekloff@elm3b216.beaverton.ibm.com>
Fri, 10 Mar 2006 09:54:25 +0000 (10:54 +0100)
committerstekloff@elm3b216.beaverton.ibm.com <stekloff@elm3b216.beaverton.ibm.com>
Fri, 10 Mar 2006 09:54:25 +0000 (10:54 +0100)
load as many disk.img domains as there are loop devices. Added a
small function to get number of loop devices to be used as a max
for number of concurrent domains the test launches.

Signed-off-by: Daniel Stekloff <dsteklof@us.ibm.com>
tools/xm-test/lib/XmTestLib/Test.py
tools/xm-test/tests/create/11_create_concurrent_pos.py

index 8f0f58df3f9f45885ea9bfa3897e9cbc4a39558b..32d1574eae9989a7cb70d56e4b0714d0b12173ea 100644 (file)
@@ -32,6 +32,7 @@ import pty
 import select
 import signal
 import re
+import glob
 
 TEST_PASS = 0
 TEST_FAIL = 255
@@ -184,7 +185,16 @@ def isConsoleDead():
     domain.destroy()
 
     return False
-    
+
+#
+# We currently can only load as many concurrent HVM domains as loop 
+# devices, need to find how many devices the system has.
+def getMaxHVMDomains():
+    nodes = glob.glob("/dev/loop*")
+    maxd = len(nodes)
+
+    return maxd
+
 
 if __name__ == "__main__":
 
index d850642e45700587d15535c19af3deaa6a61efa7..7ae74d18a6ec93798be64383c9369179772db482 100644 (file)
@@ -8,8 +8,14 @@ from XmTestLib import *
 import time
 import random
 
-MIN_DOMS    = 10
-MAX_DOMS    = 50
+if ENABLE_HVM_SUPPORT:
+    MAX_DOMS = getMaxHVMDomains()
+    if MAX_DOMS > 50:
+        MAX_DOMS = 50
+else:
+    MAX_DOMS = 50
+
+MIN_DOMS    = 5
 MEM_PER_DOM = 24
 
 domains = []